<template>
  <div class="container" style="padding-bottom: 50rpx">
    <div class="title">
      <h2>{{ data.title }}</h2>
      <p>{{ data.text }}</p>
    </div>
    <div class="swiper-comtainer">
      <div class="left w-24 h-48 pos-absolute pos-lc"></div>
      <div class="right w-24 h-48 pos-absolute pos-rc"></div>
      <SwiperV2
        :effect="'coverflow'"
        :grabCursor="true"
        :loop="true"
        :centeredSlides="true"
        slidesPerView="auto"
        :navigation="{
          nextEl: '.right',
          prevEl: '.left',
        }"
        :coverflowEffect="{
          rotate: 50,
          stretch: 0,
          depth: 100,
          modifier: 1,
          slideShadows: true,
        }"
        :modules="modules"
        class="mySwiper"
      >
        <swiper-slide
          v-for="(item, index) in data.list"
          :key="index"
          v-slot="{ isActive }"
          ><div class="content">
            <div class="image">
              <img :src="item.img" />
              <div class="name" v-if="item.name">{{ item.name }}</div>
              <div class="job" v-if="item.job">{{ item.job }}</div>
            </div>
            <div class="text" :class="{ current: isActive }">
              <span>
                {{ item.title[0] }}<br />{{ item.title[1] }}<br />{{
                  item.title[2]
                }}</span
              >
            </div>
          </div></swiper-slide
        >
      </SwiperV2>
    </div>

    <div class="more-btn">{{ data.btnText }}</div>
  </div>
</template>
<script setup>
// Import Swiper Vue.js components
import { Swiper as SwiperV2, SwiperSlide } from "swiper/vue";
// Import Swiper styles
import "swiper/css";
import "swiper/css/effect-coverflow";
import "swiper/css/pagination";
// import required modules
import { EffectCoverflow, Navigation } from "swiper/modules";
defineProps({
  data: {
    type: Object,
    default: () => {},
  },
});
const modules = [EffectCoverflow, Navigation];
</script>
<style lang="scss" scoped>
.swiper {
  width: 100%;
  height: 650rpx;
  padding-bottom: 50rpx;
  padding-top: 30rpx;
}
.swiper-comtainer {
  position: relative;
}
.swiper-slide {
  background-position: center;
  background-size: cover;
  width: 344rpx;
  height: 572rpx;
  border-radius: 3px;
  border: solid 1px #eca984;
  .content {
    height: 100%;
    .image {
      position: relative;
      .name {
        width: 100%;
        font-size: 36rpx;
        line-height: 36rpx;
        text-align: center;
        color: #feebde;
        position: absolute;
        bottom: 80rpx;
        left: 0;
      }
      .job {
        position: absolute;
        bottom: 20rpx;
        left: 0;
        margin-top: 30rpx;
        width: 100%;
        font-size: 32rpx;
        line-height: 32rpx;
        text-align: center;
        color: #ffffff;
      }
    }
    .text {
      position: absolute;
      top: 102%;
      left: 50%;
      transform: translateX(-50%);
      font-size: 24rpx;
      text-align: center;
      width: 634rpx;
      height: 137rpx;
      color: #fff;
      background: url(@/assets/comm/p9-info.png) no-repeat center;
      background-size: 634rpx 137rpx;
      display: none;
      > span {
        display: block;
        margin-top: 20rpx;
      }
    }
    .current {
      display: block;
    }
    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.left {
  z-index: 9999;
  background: url(/src/static/image/left.png) no-repeat;
  background-size: cover;
}
.right {
  z-index: 9999;
  background: url(/src/static/image/right.png) no-repeat;
  background-size: cover;
}
</style>
